-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Jest to 27.2.0
#13776
Update Jest to 27.2.0
#13776
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit b6e6671:
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/48824/ |
test/jestExportsMapResolver.cjs
Outdated
|
||
const resolvers = new Map(); | ||
function getResolver(conditionNames) { | ||
const key = conditionNames.join(":::"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: Is ":::" a hardcoded separator used by enhanced-resolve
? Can we link to where it comes from?
Ah I see, it is only used in this resolver, maybe better name it actually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just to build a cache key, to avoid reinstantiating the resolver for every request. Should I rename the map to resolversCache
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either looks good to me, I would prefer name the ":::"
actually, to signal that it is only used by us internally.
Jest 27.2.0 includes jestjs/jest#11859. It's better than the current resolution we had, because we always assumed that importer files where using
require()
. This PR aligns better Jest's behavior with the native Node.js resolution.